Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ameerul / P2PS-464 [FE] - Mandatory Mobile Number Verification for Deriv P2P (New User) #400

Conversation

ameerul-deriv
Copy link
Contributor

@ameerul-deriv ameerul-deriv commented Nov 8, 2024

  • Added new hook to get phone number verification, user's phone number, check if pnv is enabled, check if Verification should be shown
  • Replaced p2p_poa_required from get_account_status to poa_required from p2p_settings since it will be replaced in the future
  • Updated Logic to show the Verification page for new users if pnv was enabled.
  • Updated content to Verification component to include check if user's phone number is verified
  • Updated checklist UI
  • Updated test cases
  • Updated search param from poi_poa_verified to verified to be more concise
P2PS-464.Redirect.to.personal.details.mov

Screenshot 2024-11-08 at 11 40 47 AM
Screenshot 2024-11-08 at 11 41 32 AM
Screenshot 2024-11-08 at 11 41 59 AM
Screenshot 2024-11-08 at 3 48 52 PM
Screenshot 2024-11-08 at 4 05 48 PM

Screenshot 2024-11-08 at 2 00 36 PM Screenshot 2024-11-08 at 1 09 50 PM Screenshot 2024-11-08 at 2 04 24 PM Screenshot 2024-11-08 at 10 45 23 AM Screenshot 2024-11-08 at 11 22 27 AM Screenshot 2024-11-08 at 11 27 39 AM

pathname: location.pathname,
search: searchParams.toString(),
});
searchParams.set('verified', 'false');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated the param name to make it more general since now we're also checking for PNV if enabled

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a question. why do we keep this in the URL params? I mean it can be easily manipulated by the user.
can we add a hook and check this in component level using that hook? 🤔

error =>
error.code === ERROR_CODES.PERMISSION_DENIED ||
error.code === ERROR_CODES.INVALID_ADVERTISER_ID ||
error.code === ERROR_CODES.ADVERTISER_NOT_REGISTERED
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check for this edge case when user is not verified

Screenshot 2024-11-08 at 3 58 53 PM


// create new response for poi/poa statuses
const modifiedAccountStatus = useMemo(() => {
if (!data) return undefined;

const documentStatus = data?.authentication?.document?.status;
const identityStatus = data?.authentication?.identity?.status;
const isP2PPoaRequired = data?.p2p_poa_required;
const isP2PPoaRequired = !!p2pSettings?.poa_required;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BE had informed me they will be deleting p2p_poa_required in get_account_status so they added it to p2p_settings now under poa_required

pathname: location.pathname,
search: searchParams.toString(),
});
searchParams.set('verified', 'false');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a question. why do we keep this in the URL params? I mean it can be easily manipulated by the user.
can we add a hook and check this in component level using that hook? 🤔

? [
{
onClick: () => {
window.location.href = `${URLConstants.derivAppProduction}/account/personal-details`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we do the redirection based on the environment.. if test link or staging, redirect to staging-app.deriv. else app.deriv ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm i dont think its necessary tbh, because either way we can still test the PNV using just prod link. Also even if we use staging and so forth, QA still need to set up the endpoint again

Copy link

Preview Link: https://P2PS-464-mandatory-m.p2p-standalone.pages.dev

Name Result
Build status Completed ✅
Preview URL Visit Preview
Action URL Visit Action

@ameerul-deriv ameerul-deriv merged commit 7e502bf into deriv-com:master Dec 19, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants